import {Role} from "@/api/role/type.ts";

export interface ResponseLoginData {
    code: number;
    msg: string;
    data: {
        routes: [];
        token: string;
        username: string
    };
}

export interface ResponseUserInfo {
    code: number;
    msg: string;
    data: {
        routes: []
        buttons: string[];
        userInfo: {
            id: number,
            userName: string,
            avatar: string,
            loginName: string,
        }
    }
}

export interface userInfo {
    ID: number;
    CreatedAt: string;
    UpdatedAt: string;
    DeletedAt: null | string;
    user_name: string;
    login_name: string;
    password: string;
    roles: null | Role[];
    sex: number;
    age: number;
    phone: string;
    avatar: string;
    email: string;
    client_ip: string;
    status: number;
    created_user: null | userInfo;
    created_user_id: number;
    updated_user: null | userInfo;
    updated_user_id: number;
    loginTime: string;
    loginOutTime: null | string;
    deviceInfo: string;
}

export interface RequestData {
    page: number;
    pageSize: number;
    userName: string;
    loginName: string;
    phone: string;
    email: string;
    roleName: string;
    status: number;
}

export interface UserListData {
    code: number
    data: {
        userList: userInfo[];
        roleList: Role[];
        total: number;
    }
    msg: string
}

export interface CreateUserData {
    userName: string;
    loginName: string;
    password: string;
    sex: number;
    age: number;
    phone: string;
    email: string;
    roles: number[];
    status: number;
    avatar: string;
}

export interface UpdateUserData {
    ID: number;
    userName: string;
    loginName: string;
    password: string;
    sex: number;
    age: number;
    phone: string;
    email: string;
    roles: number[];
    status: number;
}

export interface UserPInfoResponse {
    code: number;
    msg: string;
    data: {
        userInfo: userInfo;
    }
}

export interface UpdateUserPInfoData {
    ID: string;
    userName: string;
    loginName: string;
    password: string;
    sex: number;
    age: number;
    phone: string;
    email: string;
}